#ifndef WIDGETFLIP_H
#define WIDGETFLIP_H

#include <QWidget>
#include <QToolButton>

class WidgetFlip : public QWidget
{
    Q_OBJECT
public:
    explicit WidgetFlip(QWidget *front, QWidget *back, QWidget *parent = 0);

    QSize sizeHint() const;

    QWidget *front() const;
    QWidget *back() const;

protected:
    void mouseDoubleClickEvent(QMouseEvent *e);
    void resizeEvent(QResizeEvent *e);
    void focusOutEvent(QFocusEvent *e);
    
signals:
    
public slots:
    void flip();

private:
    bool flipped;
    QWidget *m_front;
    QWidget *m_back;
    QToolButton *m_switchButton;
};

#endif // WIDGETFLIP_H
